export { default as http } from './http';

export interface ApiResponse<T = unknown> {
  code: number;
  message: string;
  data: T;
}

export function unwrap<T>(response: ApiResponse<T>): T {
  return response.data;
}

export async function request<T>(promise: Promise<ApiResponse<T>>): Promise<T> {
  const response = await promise;
  return response.data;
}

